<template>
  <section>
    <el-tabs v-model="activeName">
      <el-tab-pane label="地址列表" name="first">
        <address-list v-if="activeName === 'first'"></address-list>
      </el-tab-pane>
      <el-tab-pane label="导出页" name="second">
        <el-button @click="btn">转换</el-button>
      </el-tab-pane>
    </el-tabs>
  </section>
</template>

<script>
  import addressList from './addressList'
  import loadTest from './loadTest.js'
  export default {
    name: "index",
    components: {addressList},
    data(){
      return{
        activeName:'first',
        name:'孙珂'
      }
    },
    watch:{
    },
    methods:{
      btn(){
        let data='请寄：'+this.name+'这里是地址————'
        let url = window.URL.createObjectURL(new Blob([data]))
        let link = document.createElement('a');
        link.style.display = 'none';
        link.href = url;
        link.setAttribute('download', '申请单.doc');
        document.body.appendChild(link);
        link.click();
      }
    }
  }
</script>

<style scoped>
</style>
